package com.student.management.root.bean;

import java.util.Objects;

public class Grade {
    private int gradeid;
    private String gradename;

    //constructors

    public Grade(int gradeid, String gradename) {
        this.gradeid = gradeid;
        this.gradename = gradename;
    }

    public Grade() {
    }

    //getters and setters

    public int getGradeid() {
        return gradeid;
    }

    public void setGradeid(int gradeid) {
        this.gradeid = gradeid;
    }

    public String getGradename() {
        return gradename;
    }

    public void setGradename(String gradename) {
        this.gradename = gradename;
    }


    //methods

    @Override
    public String toString() {
        return "Grade{" +
                "gradeid=" + gradeid +
                ", gradename='" + gradename + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Grade)) return false;
        Grade grade = (Grade) o;
        return getGradeid() == grade.getGradeid() &&
                Objects.equals(getGradename(), grade.getGradename());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getGradeid(), getGradename());
    }
}
